package io.renren.modules.bug.enums;

import org.springframework.stereotype.Component;


public enum BugStatusEnums {
    NEW_BUG(0, "新建"),
    WAIT_BUG(1, "待处理"),
    SOLVE_BUG(2, "已修复"),
    END_BUG(3, "通过");

    private Integer statusCode;
    private String statusName;

    BugStatusEnums(Integer statusCode, String statusName) {
        this.statusCode = statusCode;
        this.statusName = statusName;
    }

    BugStatusEnums() {
    }

    public Integer getStatusCode() {
        return statusCode;
    }

    public String getStatusName() {
        return statusName;
    }
    public  static BugStatusEnums getByCode(Integer code) {
        for (BugStatusEnums status : BugStatusEnums.values()) {
            if (status.getStatusCode().equals(code)) {
                return status;
            }
        }
        return null; // 如果没有匹配的枚举常量，则返回null或抛出异常
    }
}
